import { createRouter, createWebHistory } from "vue-router";

// vite 中的环境变量 import.meta.env.BASE_URL  就是 vite.config.js 中的 base 配置项
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: "/login", component: () => import("@/views/login/LoginPage.vue") }, // 登录页
    {
      path: "/",
      component: () => import("@/views/layout/LayoutContainer.vue"),
      redirect: "/my/info",
      children: [
        {
          path: "/file/manage",
          component: () => import("@/views/file/FileManage.vue"),
        },
        {
          path: "/my/info",
          component: () => import("@/views/my/InfoView.vue"),
        },
        {
          path: "/my/log",
          component: () => import("@/views/my/LogView.vue"),
        },
      ],
    },
  ],
});

export default router;
